import request from '@/utils/request'
// 查询优惠
export function queryPromotion(data) {
    return request({
      url: '/promotion/list/page',
      method: 'post',
      data: data
    })
  }
// 修改某个优惠状态
export function updateStatus(promotionId,status) {
  return request({
    url: '/promotion/update/status/one?promotionId='+promotionId+'&status=' + status,
    method: 'post',
  })
}
// 批量修改优惠状态
export function updateManyStatus(data) {
  return request({
    url: '/promotion/update/status/many',
    method: 'post',
    data:data
  })
}
// 批量删除优惠
export function deleteManyPromotion(data) {
  return request({
    url: '/promotion/delete/many',
    method: 'post',
    data:data
  })
}
// 新增优惠
export function addPromotion(data) {
  return request({
    url: '/promotion/add',
    method: 'post',
    data:data
  })
}
// 修改优惠
export function updatePromotion(data) {
  return request({
    url: '/promotion/update/ro',
    method: 'post',
    data:data
  })
}
// 获取所有优惠
export function listPromotion() {
  return request({
    url: '/promotion/list',
    method: 'post',
  })
}
